﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using CanDoo.Data.Entity;
using CanDoo.Oil.Core.Models;

namespace CanDoo.Oil.Core.ModelConfigurations
{
    /// <summary>
    /// 实体类-数据表映射——取油码
    /// </summary>
    public class GetOilCodeConfiguration : EntityConfigurationBase<GetOilCode>
    {
        /// <summary>
        /// 初始化一个<see cref="GetOilCodeConfiguration"/>类型的新实例
        /// </summary>
        public GetOilCodeConfiguration()
        {
             ToTable("oil_GetOilCode");
             this.Property(p => p.CustomerId).HasColumnName("CustomerId");
             this.HasRequired(p => p.Customer).WithMany().HasForeignKey(p => p.CustomerId).WillCascadeOnDelete(false);

             this.Property(p => p.OilId).HasColumnName("OilId");
             this.HasRequired(p => p.Oil).WithMany().HasForeignKey(p => p.OilId).WillCascadeOnDelete(false);

        }
    }
}
